home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / DATAUTIL / DBASEUT1.LZH / DB3DIR.PRG < prev    next >
Text File  |  1987-06-09  |  2KB  |  71 lines

  1. * NAME:             DB3DIR.PRG   V 1.2
  2. * LAST UPDATE:      09/11/86                  ASCII CHR:F
  3. * DATABASE [INDEX]: DIRSTRU.DBF
  4. * REMARKS:          Create directory file in .dbf format
  5. *                   dBASEIII is a trademark of ASHTON-TATE
  6. *                   V1.2 added ability to use on multi-user system
  7. *------------------------------------------------------------------------------
  8. * initialization stuff
  9. SET EXCL ON
  10. SET TALK OFF
  11. SET HEAD OFF
  12. SET SCOR OFF
  13. SET SAFE OFF
  14. ZDRIVE=[ ]
  15. ZDEST=[ ]
  16. ZLOC=[ ]
  17. ZNAME=[        ]
  18. * Set up screen and get user inputs
  19. CLEA
  20. @ 3,10 TO 6,55 DOUB
  21. @ 4,22 SAY [DB3DIR.PRG   V 1.2]
  22. @ 5,15 SAY [dBASEIII+* .DBF-format directory program]
  23. @ 8,0
  24. TEXT
  25.    This program uses the DOS directory routine to get the list of 
  26.    files in any given drive.  It then reformats the list into a
  27.    dBASEIII .DBF file on any drive you choose.  Safety is set
  28.    off so any  xDIR.DBF  file will be overwritten ('x' is the
  29.    letter designator of the drive from which the directory is taken.)
  30.    DIRSTRU.DBF is required
  31. ENDT
  32. @ 17,7 TO 22,59 
  33. @ 18,15 SAY [Directory of which drive?: ]
  34. @ 19,15 say [Write directory to which drive? :]
  35. @ 20,15 SAY [What drive for DIRSTRU.dbf? :]
  36. @ 21,15 SAY [DBF Name? Default is xDIR>DBF  :]
  37. @ 18,45 get ZDRIVE    && directory drive
  38. @ 19,50 GET ZDEST     && drive where dir.dbf will be written
  39. @ 20,48 get ZLOC      && drive locator for dirstru.dbf
  40. @ 21,48 get ZNAME     && intermediate directory name
  41. @ 24,15 SAY [dBASEIII is a trademark of ASHTON-TATE]
  42. READ
  43. ZDOC=ZDRIVE+[DIR.DOC]
  44. IF ZNAME<>[        ]
  45.   ZNAME=ZDEST+[:]+ZNAME
  46. ELSE
  47.   ZNAME=ZDEST+[:]+ZDRIVE+[DIR]
  48. ENDIF
  49. ZDIR=[ DIR ]+ZDRIVE+[:>]+ZDEST+[:]+ZDOC && set up DOS command
  50. ZDSLOC=ZLOC+[:DIRSTRU]   &&  set up to get structure
  51. ZDDOC=ZDEST+[:]+ZDOC     &&  set up destination file
  52. SET TALK ON
  53. USE &ZDSLOC
  54. COPY STRU TO &ZNAME      && create final database
  55. !&ZDIR                   && DOS directory file creation
  56. USE &ZNAME
  57. APPE FROM &ZDDOC SDF     && fill .dbf from intermediate file
  58. GOTO 1
  59. * nxt statement deletes blanks and titles
  60. DELE FOR SUBSTR(NAME,1,1)=[ ] .OR. SUBSTR(NAME,1,1)=[.]
  61. PACK
  62. CLOS DATA
  63. SET TALK OFF
  64. ERASE &ZDDOC            && delete intermediate file
  65. CLEA
  66. @8,10 TO 10,62 DOUB
  67. @ 9,15 SAY [Name of directory file is: ]+TRIM(ZNAME)+[.DBF]
  68. SET EXCL OFF
  69.  
  70.  
  71.